home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / awksrc.zip / CONFIG~1 < prev    next >
Text File  |  1992-07-06  |  727b  |  33 lines

  1. #! /bin/sh
  2. #
  3. # configure -- produce a config.h from a known configuration
  4.  
  5. case "$#" in
  6. 1)    ;;
  7. *)    echo "Usage:  $0 system_type" >&2
  8.     echo "Known systems:  `cd config; echo ;ls -C`" >&2
  9.     exit 2
  10.     ;;
  11. esac
  12.  
  13. if [ -f config/$1 ]; then
  14.     sh ./mungeconf config/$1 config.in >config.h
  15.  
  16.     # echo #echo lines to stdout
  17.     sed -n '/^#echo /s///p' config/$1
  18.  
  19.     sed -n '/^MAKE_.*/s//s,^##&## ,,/p' config/$1 >sedscr
  20.     if [ -s sedscr ]
  21.     then
  22.         sed -f sedscr Makefile.in >Makefile
  23.     else
  24.         cp Makefile.in Makefile
  25.     fi
  26.     rm -f sedscr
  27. else
  28.     echo "\`$1' is not a known configuration."
  29.     echo "Either construct one based on the examples in the config directory,"
  30.     echo "or copy config.in to config.h and edit it."
  31.     exit 1
  32. fi
  33.